program Project2;

{$APPTYPE CONSOLE}

uses
  SysUtils;

var
  a, b, c, n, d, i : integer;


begin
  readln(a,b,c);
  if (a<=b) and (a<=c) then d:=a;
  if (b<=a) and (b<=c) then d:=b;
  if (c<=b) and (c<=a) then d:=c;
  for i:=1 to d do
    begin
    if (a mod i=0) and (b mod i=0) and (c mod i=0) then
      write(i, ' ');
    end;
readln;

end.
